package net.homeip.jcperera.nu.security.credential;

import java.io.Serializable;

import javax.inject.Named;

/**
 * Authenticates user against configured user-database backend
 * 
 * @name Authenticator class
 * @author julio.c.perera@gmail.com
 * @application nu
 * @since 0.1.0.0
 */

@Named(Authenticator.componentName)
public class Authenticator implements Serializable
{
    // Required to implement Serializable interface
    private static final long  serialVersionUID = -8019436162075070179L;

    // CoreBase properties, for easy use from other components, as well as logging
    public static final int    runtimeLevel     = 2;
    public static final String moduleName       = "security";
    public static final String componentName    = "nu_security_credential_authenticator";

    // Get the log
    // private final static Logger log = Logger.getLogger();

    // @Inject
    // Identity identity;

    public boolean authenticate()
    {
        // this.log.info("authenticating #0", this.identity.getUsername());
        // write your authentication logic here,
        // return true if the authentication was
        // successful, false otherwise
        // this.identity.addRole("admin");
        return true;
    }
}
